package round91;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int d = 1, num;
        for (int i = (1 << 1); ; i++) {
            num = 0;
            for (int j = (int) (Math.log(Integer.highestOneBit(i)) / Math.log(2)); j > 0; j--) {
                num *= 10;
                num += (i & (1 << (j - 1))) == 0 ? 4 : 7;
            }
            if (num <= n && n % num == 0) {
                System.out.println("YES");
                System.exit(0);
            }
            if (num > n)
                break;
        }
        System.out.println("NO");
    }
}
